#! /bin/bash
# Provided by azure extension which comes from template parameters
CLUSTER_NAME=$1
HAZELCAST_VERSION=$2
CLUSTER_PORT=$3
chmod +x install_hazelcast
chmod +x modify_configuration
chmod +x modify_version
python3 ./modify_configuration --cluster-name=$CLUSTER_NAME --cluster-port=$CLUSTER_PORT --filename=hazelcast.xml
python3 ./modify_version --hazelcast-version=$HAZELCAST_VERSION --filename=pom.xml
./install_hazelcast
sudo cp ./hazelcast.conf /etc/rsyslog.d/
sudo systemctl restart rsyslog.service
sudo cp ./hazelcast.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start hazelcast
